package com.jiulan.hearthearing.ui.my.adapter;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;
import com.jiulan.hearthearing.ui.my.model.CoursePurchasedModle;
import com.shehuan.niv.NiceImageView;

import java.util.List;

public class CoursesPurchasedAdapter extends BaseQuickAdapter<CoursePurchasedModle.DataBean, BaseViewHolder> {

    public CoursesPurchasedAdapter(List<CoursePurchasedModle.DataBean> data) {
        super(R.layout.item_course_purchased, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CoursePurchasedModle.DataBean item) {
        NiceImageView nivPic = helper.getView(R.id.nivPic);
        Glide.with(mContext).load(item.getLecturer().getPic()).into(nivPic);
        helper.setText(R.id.tvTitle, item.getTitle());
        helper.setText(R.id.tvContent, item.getShort_title());
        helper.setText(R.id.tvAuthor, item.getLecturer().getName() + "·" + item.getLecturer().getTitle());
        helper.addOnClickListener(R.id.tvCheck);
    }
}
